package com.xyw.his00.pojo.dbpojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xyw.his00.pojo.newpojo.ExportPdfFileTemplate;
import com.xyw.his00.service.newservice.ExportPdf;
import jakarta.validation.constraints.NotNull;
import lombok.*;

import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = true)//todo:???啥意思
@Data

@TableName("check_request")
public class CheckRequest extends ExportPdfFileTemplate implements ExportPdf {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    private Integer registerId;//挂号id

    private Integer medicalTechnologyId;

    private String checkInfo;//检查信息

    private String checkPosition;//

    private LocalDateTime creationTime;

    private Integer checkEmployeeId;//查检医生id

    private Integer inputcheckEmployeeId;//输结果医生id

    private LocalDateTime checkTime;//检查时间

    private String checkResult;//结果

    private String checkState;//状态（已开立，已缴费，已经出了结果，已经退费，已作废）

    private String checkRemark;

    public CheckRequest(Integer id, Integer registerId, Integer medicalTechnologyId, String checkInfo, String checkPosition, LocalDateTime creationTime, Integer checkEmployeeId, Integer inputcheckEmployeeId, LocalDateTime checkTime, String checkResult, String checkState, String checkRemark) {
        this.id = id;
        this.registerId = registerId;
        this.medicalTechnologyId = medicalTechnologyId;
        this.checkInfo = checkInfo;
        this.checkPosition = checkPosition;
        this.creationTime = creationTime;
        this.checkEmployeeId = checkEmployeeId;
        this.inputcheckEmployeeId = inputcheckEmployeeId;
        this.checkTime = checkTime;
        this.checkResult = checkResult;
        this.checkState = checkState;
        this.checkRemark = checkRemark;
    }

    //构建初次检查对象

    public CheckRequest(Integer registerId, Integer medicalTechnologyId, String checkInfo, String checkPosition, LocalDateTime creationTime, String checkRemark,String checkState) {
        this.registerId = registerId;
        this.medicalTechnologyId = medicalTechnologyId;
        this.checkInfo = checkInfo;
        this.checkPosition = checkPosition;
        this.creationTime = creationTime;
        this.checkRemark = checkRemark;
        this.checkState=checkState;
    }
    public CheckRequest(){

    }

    @Override
    public ExportPdfFileTemplate createPdf(Class<? extends ExportPdf> exportedPdfClass) {
        return  new ExportPdfFileTemplate(
                getRegisterId(),
                getMedicalTechnologyId(),
                getCheckInfo(),
                getCheckPosition(),
                getCreationTime(),
                getCheckEmployeeId(),
                getInputcheckEmployeeId(),
                getCheckTime(),
                getCheckResult(),
                getCheckState(),
                getCheckRemark()
        );
    }
}
